# -*- coding:utf-8 -*-
from datetime import datetime
from typing import Dict

from apscheduler.schedulers.asyncio import AsyncIOScheduler
from Model.scheduler.settings import settings

scheduler = AsyncIOScheduler()


async def init_scheduler():
    scheduler.configure(**settings.dict())
    print("---------初始化 scheduler --------")
    # schedule test
    # scheduler.add_job(func=init_echo, trigger="date", next_run_time=datetime.now())
    scheduler.start()

def run(msg: str, verbose: bool = False):
        return mytask(msg,verbose)

def mytask(msg: str, verbose: bool = False) -> Dict[str, str]:
    """   打印时间  """
    if verbose:
        print("----",datetime.now())
    return {"message": msg}



 